<?php

use yii\helpers\Inflector;
use yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */

$urlParams = $generator->generateUrlParams();

echo "<?php\n";
?>

use backend\components\helper\EasyHtml;
use backend\components\widget\adminLTE\DetailView;

/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */

$this->title = "详情查看";//$model-><?= $generator->getNameAttribute() ?>
$this->params['breadcrumbs'][] = ['label' => <?= $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>, 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title"><?= "<?= " ?>EasyHtml::encode($this->title) ?></h3>
                <div class="box-tools pull-right">
                    <?= "<?= " ?>EasyHtml::iconLink('编辑', ['update', <?= $urlParams ?>], [
                        'icon'=>'pencil',
                        'class' => 'btn btn-primary'
                    ]) ?>
                    <?= "<?= " ?>EasyHtml::iconLink('删除', ['delete', <?= $urlParams ?>], [
                            'icon' => 'trash-o',
                            'class' => 'btn btn-danger',
                            'data' => [
                            'confirm' => <?= $generator->generateString('确定要删除此项?') ?>,
                            'method' => 'post',
                        ],
                    ]) ?>
                    <?= "<?= " ?>EasyHtml::a('<i class="fa fa-arrow-left"></i> 返回', ['index'], ['class' => 'btn btn-default']) ?>
                </div>
            </div>
            <div class="box-body">
                <?= "<?= " ?>DetailView::widget([
                    'model' => $model,
                    'attributes' => [
                    <?php
                    if (($tableSchema = $generator->getTableSchema()) === false) {
                        foreach ($generator->getColumnNames() as $name) {
                            echo "            '" . $name . "',\n";
                        }
                    } else {
                        foreach ($generator->getTableSchema()->columns as $column) {
                            $format = $generator->generateColumnFormat($column);
                            echo "            '" . $column->name . ($format === 'text' ? "" : ":" . $format) . "',\n";
                        }
                    }
                    ?>
                    ],
                ]) ?>
            </div>
        </div>
    </div>
</div>
